Skip to content

Conversation

@Siilwyn
Copy link

@Siilwyn Siilwyn commented Jan 23, 2026

πŸ”— Linked issue

#2973

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Add Scaleway serverless functions preset.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Other

Open to all feedback, I'm figuring out what to add further to the documentation and preset config so deploys go as easy as possible.

@vercel
Copy link

vercel bot commented Jan 23, 2026

@Siilwyn is attempting to deploy a commit to the Nitro Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

πŸ“ Walkthrough

Walkthrough

Adds a Scaleway Serverless preset: new preset module and runtime handler, updates preset registry and types, adds Scaleway deployment docs and an integration test, and adds @scaleway/serverless-functions as a devDependency. (30 words)

Changes

Cohort / File(s) Summary
Scaleway preset & runtime
src/presets/scaleway/preset.ts, src/presets/scaleway/runtime/scaleway-serverless.ts
New preset scaleway-serverless and runtime handler that adapts Scaleway serverless events into HTTP requests and forwards them to the Nitro app via nitroApp.fetch.
Preset registry
src/presets/_all.gen.ts
Imports and includes the new Scaleway preset in the aggregated presets export.
Type updates
src/presets/_types.gen.ts
Extends PresetName to include "scaleway-serverless" and PresetNameInput to accept "scaleway-serverless", "scalewayServerless", and "scaleway_serverless".
Documentation
docs/2.deploy/20.providers/scaleway.md
New documentation page for deploying Nitro apps to Scaleway Serverless.
Tests
test/presets/scaleway.test.ts
New integration test that builds/loads the handler, starts a local HTTP server on a random port, and proxies fetch requests to validate the runtime.
Dev dependency
package.json
Adds @scaleway/serverless-functions to devDependencies.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

πŸš₯ Pre-merge checks | βœ… 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (2 passed)
Check name Status Explanation
Title check βœ… Passed The pull request title 'feat: Add Scaleway serverless function preset' follows conventional commits format with a descriptive summary that accurately reflects the main change of adding a new Scaleway preset.
Description check βœ… Passed The pull request description is directly related to the changeset, clearly documenting the addition of the Scaleway serverless functions preset with linked issues, change types, and documentation updates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • πŸ“ Generate docstrings
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. πŸŽ‰

🧹 Recent nitpick comments
docs/2.deploy/20.providers/scaleway.md (1)

1-7: Consider adding basic deployment instructions.

The documentation is minimal compared to what users might need. A brief section covering how to deploy (e.g., the Scaleway CLI command, required environment variables, or a link to a step-by-step guide) would help users get started without leaving the Nitro docs.

Warning

Review ran into problems

πŸ”₯ Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Siilwyn Siilwyn force-pushed the scaleway branch 3 times, most recently from 1b2a136 to f8c6e3a Compare January 23, 2026 15:20
@Siilwyn Siilwyn marked this pull request as ready for review January 23, 2026 15:24
@Siilwyn Siilwyn requested a review from pi0 as a code owner January 23, 2026 15:24
@Siilwyn
Copy link
Author

Siilwyn commented Jan 23, 2026

Moved from draft so CodeRabbit picks it up.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

πŸ€– Fix all issues with AI agents
In `@src/presets/scaleway/runtime/scaleway-serverless.ts`:
- Around line 11-29: In handler, remove non-null assertions on event.headers and
event.queryStringParameters and guard them with safe fallbacks (e.g., const hdrs
= event.headers ?? {}; const qs = event.queryStringParameters ?? {}), iterate
hdrs safely when building headers map, and perform a case-insensitive lookup for
X-Forwarded-Proto (check hdrs["x-forwarded-proto"] and hdrs["X-Forwarded-Proto"]
or normalize keys) when composing the origin for joinURL; also handle body
decoding based on event.isBase64Encoded (decode to string/buffer when true) and
treat both GET and HEAD as having no body when constructing the Request. Ensure
you update references in handler to use these new locals (hdrs, qs, decodedBody)
and remove any remaining ! non-null assertions.
🧹 Nitpick comments (1)
docs/2.deploy/20.providers/scaleway.md (1)

1-7: Add a minimal config snippet for quicker onboarding.

A short nitro.config example would make the preset immediately actionable for readers skimming the page.

✍️ Example addition
 # Scaleway

 > Deploy Nitro apps to Scaleway.

 **Preset:** `scaleway-serverless`

+```ts
+// nitro.config.ts
+export default defineNitroConfig({
+  preset: "scaleway-serverless",
+});
+```
+
 :read-more{title="Scaleway Serverless Functions" to="https://www.scaleway.com/en/docs/serverless-functions/"}

@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2026

βœ… Actions performed

Reviews resumed.

@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2026

βœ… Actions performed

Full review triggered.

},
},
{
name: "scaleway-serverless" as const,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might choose a more clearname for this, perhaps We might choose a better name perhaps scaleway-functions?

(since we also have Scaleway serverless containers product)

headers.get("Host")!,
event.path
),
event.queryStringParameters ?? {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please refactor to use https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams to stringify queryStringParameters? (also don't we have access to original request string?)

import { useNitroApp } from "nitro/app";
import { joinURL, withQuery } from "ufo";
import type { serveHandler } from "@scaleway/serverless-functions";
import { Buffer } from "node:buffer";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buffer should be available globally

import { defineNitroPreset } from "../_utils/preset.ts";

const scalewayServerless = defineNitroPreset(
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might enable serve static handler (with inlined contents) or explain it in docs (containers have better support for static assets i guess also)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 9, 2026

Open in StackBlitz

npm i https://pkg.pr.new/nitrojs/nitro@3970

commit: eea312f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants